/*   1:    */ package org.jetbrains.jps.model.artifact.impl.elements;
/*   2:    */ 
/*   3:    */

import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.artifact.JpsArtifactReference;
import org.jetbrains.jps.model.artifact.elements.*;
import org.jetbrains.jps.model.library.JpsLibraryReference;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */
/*  20:    */ 
/*  21:    */ public class JpsPackagingElementFactoryImpl
/*  22:    */   extends JpsPackagingElementFactory
/*  23:    */ {
/*  24:    */   @NotNull
/*  25:    */   public JpsDirectoryCopyPackagingElement createDirectoryCopy(@NotNull String paramString)
/*  26:    */   {
/*  27: 34 */     if (paramString == null) {
/*  28: 34 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createDirectoryCopy" }));
/*  29:    */     }
/*  30: 34 */     void tmp48_45 = new JpsDirectoryCopyPackagingElementImpl(paramString);
/*  31: 34 */     if (tmp48_45 == null) {
/*  32: 34 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createDirectoryCopy" }));
/*  33:    */     }
/*  34: 34 */     return tmp48_45;
/*  35:    */   }
/*  36:    */   
/*  37:    */   public JpsPackagingElement createParentDirectories(String paramString, JpsPackagingElement paramJpsPackagingElement)
/*  38:    */   {
/*  39: 39 */     paramString = StringUtil.trimStart(paramString, "/");
/*  40: 40 */     if (paramString.length() == 0) {
/*  41: 41 */       return paramJpsPackagingElement;
/*  42:    */     }
/*  43: 43 */     int i = paramString.indexOf('/');
/*  44: 44 */     if (i == -1) {
/*  45: 44 */       i = paramString.length();
/*  46:    */     }
/*  47: 45 */     String str1 = paramString.substring(0, i);
/*  48: 46 */     String str2 = paramString.substring(i);
/*  49: 47 */     JpsDirectoryPackagingElement localJpsDirectoryPackagingElement = createDirectory(str1);
/*  50: 48 */     JpsCompositePackagingElement localJpsCompositePackagingElement = a(localJpsDirectoryPackagingElement, str2, true);
/*  51: 49 */     localJpsCompositePackagingElement.addChild(paramJpsPackagingElement);
/*  52: 50 */     return localJpsDirectoryPackagingElement;
/*  53:    */   }
/*  54:    */   
/*  55:    */   public JpsCompositePackagingElement getOrCreateDirectory(@NotNull JpsCompositePackagingElement paramJpsCompositePackagingElement, @NotNull String paramString)
/*  56:    */   {
/*  57: 55 */     if (paramJpsCompositePackagingElement == null) {
/*  58: 55 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateDirectory" }));
/*  59:    */     }
/*  60: 55 */     if (paramString == null) {
/*  61: 55 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateDirectory" }));
/*  62:    */     }
/*  63: 55 */     return a(paramJpsCompositePackagingElement, paramString, true);
/*  64:    */   }
/*  65:    */   
/*  66:    */   public JpsCompositePackagingElement getOrCreateArchive(@NotNull JpsCompositePackagingElement paramJpsCompositePackagingElement, @NotNull String paramString)
/*  67:    */   {
/*  68: 60 */     if (paramJpsCompositePackagingElement == null) {
/*  69: 60 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateArchive" }));
/*  70:    */     }
/*  71: 60 */     if (paramString == null) {
/*  72: 60 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateArchive" }));
/*  73:    */     }
/*  74: 60 */     return a(paramJpsCompositePackagingElement, paramString, false);
/*  75:    */   }
/*  76:    */   
/*  77:    */   @NotNull
/*  78:    */   private JpsCompositePackagingElement a(@NotNull JpsCompositePackagingElement paramJpsCompositePackagingElement, @NotNull @NonNls String paramString, boolean paramBoolean)
/*  79:    */   {
/*  80: 66 */     if (paramJpsCompositePackagingElement == null) {
/*  81: 66 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateDirectoryOrArchive" }));
/*  82:    */     }
/*  83: 66 */     if (paramString == null) {
/*  84: 66 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateDirectoryOrArchive" }));
/*  85:    */     }
/*  86: 66 */     paramString = StringUtil.trimStart(StringUtil.trimEnd(paramString, "/"), "/");
/*  87: 67 */     if (paramString.length() == 0)
/*  88:    */     {
/*  89: 68 */       JpsCompositePackagingElement tmp100_99 = paramJpsCompositePackagingElement;
/*  90: 68 */       if (tmp100_99 == null) {
/*  91: 68 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateDirectoryOrArchive" }));
/*  92:    */       }
/*  93: 68 */       return tmp100_99;
/*  94:    */     }
/*  95: 70 */     int i = paramString.lastIndexOf('/');
/*  96: 71 */     String str1 = paramString.substring(i + 1);
/*  97: 72 */     String str2 = i != -1 ? paramString.substring(0, i) : "";
/*  98:    */     
/*  99: 74 */     JpsCompositePackagingElement localJpsCompositePackagingElement = a(paramJpsCompositePackagingElement, str2, true);
/* 100: 75 */     JpsArchivePackagingElement localJpsArchivePackagingElement = paramBoolean ? createDirectory(str1) : createArchive(str1); JpsCompositePackagingElement 
/* 101: 76 */       tmp216_213 = ((JpsCompositePackagingElement)localJpsCompositePackagingElement.addChild(localJpsArchivePackagingElement));
/* 102: 76 */     if (tmp216_213 == null) {
/* 103: 76 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "getOrCreateDirectoryOrArchive" }));
/* 104:    */     }
/* 105: 76 */     return tmp216_213;
/* 106:    */   }
/* 107:    */   
/* 108:    */   @NotNull
/* 109:    */   public JpsFileCopyPackagingElement createFileCopy(@NotNull String paramString1, @Nullable String paramString2)
/* 110:    */   {
/* 111: 82 */     if (paramString1 == null) {
/* 112: 82 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createFileCopy" }));
/* 113:    */     }
/* 114: 82 */     void tmp49_46 = new JpsFileCopyPackagingElementImpl(paramString1, paramString2);
/* 115: 82 */     if (tmp49_46 == null) {
/* 116: 82 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createFileCopy" }));
/* 117:    */     }
/* 118: 82 */     return tmp49_46;
/* 119:    */   }
/* 120:    */   
/* 121:    */   @NotNull
/* 122:    */   public JpsExtractedDirectoryPackagingElement createExtractedDirectory(@NotNull String paramString1, @NotNull String paramString2)
/* 123:    */   {
/* 124: 88 */     if (paramString1 == null) {
/* 125: 88 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createExtractedDirectory" }));
/* 126:    */     }
/* 127: 88 */     if (paramString2 == null) {
/* 128: 88 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createExtractedDirectory" }));
/* 129:    */     }
/* 130: 88 */     void tmp89_86 = new JpsExtractedDirectoryPackagingElementImpl(paramString1, paramString2);
/* 131: 88 */     if (tmp89_86 == null) {
/* 132: 88 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createExtractedDirectory" }));
/* 133:    */     }
/* 134: 88 */     return tmp89_86;
/* 135:    */   }
/* 136:    */   
/* 137:    */   @NotNull
/* 138:    */   public JpsDirectoryPackagingElement createDirectory(@NotNull String paramString)
/* 139:    */   {
/* 140: 94 */     if (paramString == null) {
/* 141: 94 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createDirectory" }));
/* 142:    */     }
/* 143: 94 */     void tmp48_45 = new JpsDirectoryPackagingElementImpl(paramString);
/* 144: 94 */     if (tmp48_45 == null) {
/* 145: 94 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createDirectory" }));
/* 146:    */     }
/* 147: 94 */     return tmp48_45;
/* 148:    */   }
/* 149:    */   
/* 150:    */   @NotNull
/* 151:    */   public JpsArchivePackagingElement createArchive(@NotNull String paramString)
/* 152:    */   {
/* 153:100 */     if (paramString == null) {
/* 154:100 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createArchive" }));
/* 155:    */     }
/* 156:100 */     void tmp48_45 = new JpsArchivePackagingElementImpl(paramString);
/* 157:100 */     if (tmp48_45 == null) {
/* 158:100 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createArchive" }));
/* 159:    */     }
/* 160:100 */     return tmp48_45;
/* 161:    */   }
/* 162:    */   
/* 163:    */   @NotNull
/* 164:    */   public JpsArtifactRootElement createArtifactRoot()
/* 165:    */   {
/* 166:106 */     void tmp7_4 = new JpsArtifactRootElementImpl();
/* 167:106 */     if (tmp7_4 == null) {
/* 168:106 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createArtifactRoot" }));
/* 169:    */     }
/* 170:106 */     return tmp7_4;
/* 171:    */   }
/* 172:    */   
/* 173:    */   @NotNull
/* 174:    */   public JpsLibraryFilesPackagingElement createLibraryElement(@NotNull JpsLibraryReference paramJpsLibraryReference)
/* 175:    */   {
/* 176:112 */     if (paramJpsLibraryReference == null) {
/* 177:112 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createLibraryElement" }));
/* 178:    */     }
/* 179:112 */     void tmp48_45 = new JpsLibraryFilesPackagingElementImpl(paramJpsLibraryReference);
/* 180:112 */     if (tmp48_45 == null) {
/* 181:112 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createLibraryElement" }));
/* 182:    */     }
/* 183:112 */     return tmp48_45;
/* 184:    */   }
/* 185:    */   
/* 186:    */   @NotNull
/* 187:    */   public JpsArtifactOutputPackagingElement createArtifactOutput(@NotNull JpsArtifactReference paramJpsArtifactReference)
/* 188:    */   {
/* 189:118 */     if (paramJpsArtifactReference == null) {
/* 190:118 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createArtifactOutput" }));
/* 191:    */     }
/* 192:118 */     void tmp48_45 = new JpsArtifactOutputPackagingElementImpl(paramJpsArtifactReference);
/* 193:118 */     if (tmp48_45 == null) {
/* 194:118 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsPackagingElementFactoryImpl", "createArtifactOutput" }));
/* 195:    */     }
/* 196:118 */     return tmp48_45;
/* 197:    */   }
/* 198:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.artifact.impl.elements.JpsPackagingElementFactoryImpl

 * JD-Core Version:    0.7.0.1

 */